//
//  YWAttachmentManager.h
//  maintain
//
//  Created by Kyo on 16/3/18.
//  Copyright © 2016年 ewin. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "YWSingleton.h"
#import "YWattachment.h"

@interface YWAttachmentManager : NSObject
YWSingletonH(Manager)

/**
 *  保存附件
 *
 *  @param attachments 附件模型数组
 *
 *  @return 结果
 */
- (BOOL)updateAttachmentWithAttachments:(NSArray*)attachments;
/**
 *  更新附件的缓存Name
 *
 *  @param attachments 附件模型数组
 *
 *  @return 结果
 */
- (BOOL)updateAttachmenLocalNameWithAttachment:(YWattachment*)attachment;
/**
 *  获取附件
 *
 *  @param recordId 关联Id
 *  @param type 附件类型
 *
 *  @return 结果
 */
- (NSArray *)attachmentWithRecordId:(NSInteger)recordId andType:(YWattachmentType)type;
/**
 *  下载附件
 *
 *  @param url 地址url
 *  @param complete 完成后的回调
 *
 *  @return 无
 */

- (void)downloadFile:(NSString*)objectKey toFilePath:(NSString*)path progressBlock:(void (^)(float progress))progressBlock completeBlock:(void (^)(BOOL success))completeBlock;
@end
